package com.nanyang.tms.api.dto.request.company;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nanyang.common.core.domain.ApiRequest;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Data
public class CompanyAddRequest extends ApiRequest {

    @JsonIgnore
    private String pin;

    @NotEmpty(message = "手机号格不能为空")
    @Pattern(regexp = "1[3|4|5|6|7|8|9][0-9]{9}$", message = "手机号格式不正确")
    private String mobile;

    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,20}$", message = "密码长度应至少含1个数字，1个大写字母，1个小写字母")
    @Length(min = 8, max = 20, message = "密码长度应为8-20位")
    private String password;
    /**
     * 企业简称
     */
    @NotEmpty(message = "企业简称不能为空")
    @Length(max = 50, message = "companyName长度需小于50个字符")
    private String companyName;

    /**
     * 企业全称
     */
    @NotEmpty(message = "企业全称不能为空")
    @Length(max = 100, message = "companyFullName长度需小于100个字符")
    private String companyFullName;

    /**
     * 省
     */
    @NotEmpty(message = "省不能为空")
    @Length(max = 30, message = "province长度需小于30个字符")
    private String province;

    /**
     * 市
     */
    @NotEmpty(message = "市不能为空")
    @Length(max = 30, message = "city长度需小于30个字符")
    private String city;

    /**
     * 区
     */
    @NotEmpty(message = "区不能为空")
    @Length(max = 30, message = "district长度需小于30个字符")
    private String district;
    /**
     * 详细地址
     */
    @NotEmpty(message = "详细地址不能为空")
    @Length(max = 100, message = "address长度需小于100个字符")
    private String address;

    /**
     * 营业执照url
     */
    @NotEmpty(message = "营业执照url不能为空")
    @Length(max = 500, message = "companyAuthUrl长度需小于500个字符")
    private String companyAuthUrl;

    /**
     * 法人身份证正面url
     */
    @NotEmpty(message = "法人身份证正面url不能为空")
    @Length(max = 500, message = "idPurl长度需小于500个字符")
    private String idPurl;

    /**
     * 法人身份证反面url
     */
    @NotEmpty(message = "法人身份证反面url不能为空")
    @Length(max = 500, message = "idNurl长度需小于500个字符")
    private String idNurl;


    @Override
    public void requestCheck() {

    }
}
